package com.luych.toolbox.common.feign.view.data.service;

import com.luych.toolbox.common.enums.DataRecoveryHistoryStatus;
import com.luych.toolbox.common.enums.DataRecoveryHistoryType;
import com.luych.toolbox.common.feign.FeignView;
import com.luych.toolbox.common.feign.view.base.service.UserView;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

@ApiModel("数据恢复历史")
public class DataRecoveryHistoryView extends FeignView {

    @ApiModelProperty("数据备份历史")
    private DataBackupHistoryView dataBackupHistory;
    @ApiModelProperty("描述")
    private String name;
    @ApiModelProperty("类型")
    private DataRecoveryHistoryType type;
    @ApiModelProperty("状态")
    private DataRecoveryHistoryStatus status;
    @ApiModelProperty("异常信息")
    private String errorMessage;
    @ApiModelProperty("异常堆栈")
    private String errorTrace;
    @ApiModelProperty("责任人")
    private UserView owner;
    @ApiModelProperty("开始时间")
    private Date startDate;
    @ApiModelProperty("结束时间")
    private Date completeDate;

    public DataBackupHistoryView getDataBackupHistory() {
        return dataBackupHistory;
    }

    public String getDataBackupHistoryId() {
        return dataBackupHistory == null ? null : dataBackupHistory.getId();
    }

    public void setDataBackupHistory(DataBackupHistoryView dataBackupHistory) {
        this.dataBackupHistory = dataBackupHistory;
    }

    public DataSourceView getDataSource() {
        return dataBackupHistory == null ? null : dataBackupHistory.getDataSource();
    }

    public DataAgentView getDataAgent() {
        return dataBackupHistory == null ? null : dataBackupHistory.getDataAgent();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public DataRecoveryHistoryType getType() {
        return type;
    }

    public String getTypeValue() {
        return type == null ? null : type.getValue();
    }

    public void setType(DataRecoveryHistoryType type) {
        this.type = type;
    }

    public DataRecoveryHistoryStatus getStatus() {
        return status;
    }

    public void setStatus(DataRecoveryHistoryStatus status) {
        this.status = status;
    }

    public String getStatusValue() {
        return status == null ? null : status.getValue();
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public String getErrorTrace() {
        return errorTrace;
    }

    public void setErrorTrace(String errorTrace) {
        this.errorTrace = errorTrace;
    }

    public UserView getOwner() {
        return owner;
    }

    public void setOwner(UserView owner) {
        this.owner = owner;
    }

    public String getOwnerId() {
        return owner == null ? null : owner.getId();
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getCompleteDate() {
        return completeDate;
    }

    public void setCompleteDate(Date completeDate) {
        this.completeDate = completeDate;
    }
}
